

function formatnum(val){
    return val>9?val:'0'+val
}
function str2num(val){
    return val*1;
}
function num2str(val){
    return val+'';
}
function time2date(val){
    if(!val){return '0000-00-00'}
var time=new Date(val);
    var y=time.getFullYear();
    var m=time.getMonth()+1;
    var d=time.getDate();
    m=formatnum(m);
    d=formatnum(d);
    return y+'-'+m+'-'+d;
}

function neg2nul(val){
return val=='-1'?'':val
}
export default {
formatnum,str2num,num2str,time2date,neg2nul
}